package com.wrl.mmall.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.wrl.mmall.pojo.Product;

public interface ProductMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Product record);

    int insertSelective(Product record);

    Product selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Product record);

    int updateByPrimaryKey(Product record);

    //查询所有商品
    List<Product> selectList();
    //根据商品名和商品id查找
	List<Product> selectByNameAndProductId(@Param("productName")String productName,@Param("productId") Integer productId);
	//
	List<Product> selectByNameAndCategoryId(@Param("productName")String productName,@Param("productIdList") List<Integer> productIdList);

	//这里一定要用Integer。加了一个悲观锁
    Integer selectStockByProductId(Integer id);
}